package contacttransmut;

import org.w3c.dom.Document;



/**
 * Interface for input filter.
 *
 * Input filter reads file of certain format and produces an internal Document that is meant to be processed by GUI and InternalDocCompiler
 *
 * it should have a constructor with parameters to set up options for loading the input file (see below)
 * output is facilitated by the two methods
 * output formats: Document (as "InternalDoc" produced by ReadCSV implementation)
 *                 InternalDocColumnSchema (there is already an implementation InternalDocColumnSchemaImpl)
 * If the read file is already tagged (eg VCF), InternalDocColumnSchema should be generated by read() method and
 * returned by getColumnSchema() method!
 * When generating the InternalDocColumnSchema watch the cardinality of VCF types => use merge
 * 
 * @author      Jakub Svoboda
 *
 */
public interface InputFilter {

    /**
     * Reads the file specified in class constructor
     * 
     * should allow to choose filename, encoding and filetype-specific parameters
     * Document format should be exactly the same as in ReadCSV implementation
     * If the loaded file has some schema information (what is phone, address, etc), then create non-blank InternalDocColumnSchema
     * 
     * @return Document intended for processing in GUI and InternalDocCompiler ("InternalDoc")
     */
    public Document read();

     //if no columnschema was read, should return null!
    /*
     * Returns ColumnSchema for the read file.
     *
     * Some file formats include metadata - labels saying what certain data are (telephone, address, ...).
     * This method returns ColumnSchema with "candidatetype"s set for known metadata.
     * If no columnschema was read, it should return null
     *
     * @return Document intended for processing in GUI and InternalDocCompiler ("ColumnSchema")
     */
     public InternalDocColumnSchema getColumnSchema();

}
